﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ComponentModel;

namespace Delay
{
    public class ReplyResult :DependencyObject,INotifyPropertyChanged
    {
        private int _result;
        public int Result
        {
            get
            {
                return _result;
            }
            set
            {
                if (_result != value)
                {
                    _result = value;
                    NotifyPropertyChanged("Result");
                }
            }
        }
        public string ResultMsg
        {
            get;
            set;
        }
        public int  IsLogo
        {
            get;
            set;
        }//
        public string className
        {
            get;
            set;
        }
        public string GetPhoneInfoUrl(string pid, string quality, string breed, string price, string effect, string face, string other)
        {
            //这个函数不同的类一般要改写
            string url;
            url = QueryXml.PhonePhoneAddPkVoteUrl;
            url += ("imei=" + QueryXml.imei);
            url += ("&phonename=" + QueryXml.phonename);
            url += ("&phonevs=" + QueryXml.phonevs);
            url += ("&phonevsno=" + QueryXml.phonevsno);
            url += ("&keyvalue=" + QueryXml.keyvalue);
            url += ("&channelkey=" + QueryXml.channelkey);
            url += ("&softid=" + QueryXml.appid);
            url += ("&pid=" + pid.ToString());
            if (quality == "true")
            {
                url += ("&quality=1");
            }
            else
            {
                url += ("&quality=0");
            }
            if (breed == "true")
            {
                 url += ("&breed=1" );
            }
            else
            {
                 url += ("&breed=0" );
            }
            if (price == "true")
            {
                url += ("&price=1");
            }
            else
            {
                url += ("&price=0");
            }
            if (effect == "true")
            {
                url += ("&effect=1");
            }
            else
            {
                url += ("&effect=0");
            }
            if (face == "true")
            {
                url += ("&face=1");
            }
            else
            {
                url += ("&face=0");
            }
            if (face == "true")
            {
                url += ("&other=1");
            }
            else
            {
                url += ("&other=0");
            }
          
            //
            return url;
        }
        public string GetPhoneInfoUrl( string topicid, string content,InfoType pageType,string lxt)
        {
            //这个函数不同的类一般要改写
            string url;
            if (pageType==InfoType.Info)
            {
                 url = QueryXml.PhoneEyeCommentUrl;
            }
            else
            {
                url = QueryXml.PhoneEyeContentUrl;
            }
            url += ("imei=" + QueryXml.imei);
            url += ("&phonename=" + QueryXml.phonename);
            url += ("&phonevs=" + QueryXml.phonevs);
            url += ("&phonevsno=" + QueryXml.phonevsno);
            url += ("&keyvalue=" + QueryXml.keyvalue);
            url += ("&channelkey=" + QueryXml.channelkey);
            url += ("&topicid=" + topicid.ToString());
            url += ("&softid=" + QueryXml.appid);
            if (lxt.Length>0)
            {
                url += ("&lxt=" + lxt);
            }
            url += ("&content=" + content.ToString());
            //

            return url;
        }
        //
        public string GetPhoneInfoUrl(string topicid, int score, string advant,string defect)
        {
            //这个函数不同的类一般要改写
            string url=QueryXml.PhoneTypeAddCommentUrl;
            url += ("imei=" + QueryXml.imei);
            url += ("&phonename=" + QueryXml.phonename);
            url += ("&phonevs=" + QueryXml.phonevs);
            url += ("&phonevsno=" + QueryXml.phonevsno);
            url += ("&keyvalue=" + QueryXml.keyvalue);
            url += ("&channelkey=" + QueryXml.channelkey);
            url += ("&pid=" + topicid);
            url += ("&score=" + score.ToString());
            url += ("&softid=" + QueryXml.appid);
            url += ("&advant=" + advant);
            url += ("&defect=" + defect);
            //
            return url;
        }
        public string GetPhoneInfoUrl(string content, string softvs)
        {
            //这个函数不同的类一般要改写
            string url = QueryXml.PhoneMessageBoardUrl;
            url += ("imei=" + QueryXml.imei);
            url += ("&phonename=" + QueryXml.phonename);
            url += ("&phonevs=" + QueryXml.phonevs);
            url += ("&phonevsno=" + QueryXml.phonevsno);
            url += ("&keyvalue=" + QueryXml.keyvalue);
            url += ("&channelkey=" + QueryXml.channelkey);
            url += ("&appid=" + QueryXml.appid);
            url += ("&content=" + content);
            url += ("&softvs=" + softvs);
            //
            return url;
        }
        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(String propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (null != handler)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
